/*
 * Scaffold Application Framework
 *
 * Copyright (c) 2010 Sii Sp. z o.o. All rights reserved.
 */
package com.gdziarmaga.webshop.web.managedBeans.book;

import com.gdziarmaga.webshop.book.model.Book;
import com.gdziarmaga.webshop.web.datatable.BaseTableRow;
import com.gdziarmaga.webshop.web.datatable.CellStyles;
import com.gdziarmaga.webshop.web.datatable.RowStyles;


/**
 * Holds row's data of table with {@link BookTableDataModel}.
 * 
 * @author Wojciech Kochman
 * @version 1.0
 */
public class BookTableRow extends BaseTableRow<Book> {

    /**
     * Default constructor.
     * 
     * @param domainObject the domain Object
     */
    public BookTableRow(Book domainObject) {
        super(domainObject);
        this.cellStyle = new CellStyle();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getRowStyle() {
        String result = null;
//        if (!this.domainObject.getRecordInfo().isActive()) {
            result = RowStyles.RED.getStyleClass();
//        }
        return result;
    }

    /**
     * Provides methods to get cell styles.
     * 
     * @author Wojciech Kochman
     * @version 1.0
     */
    public class CellStyle extends BaseTableRow<Book>.BaseCellStyle {
        /**
         * Gets the 'last name' cell style.
         * 
         * @return the style class
         */
        public String getLastName() {
            return CellStyles.GREEN.getStyleClass();
        }
    }
}
